home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks ’92 / TileHackƒ / TileHack.c next >
Encoding:
C/C++ Source or Header  |  1992-06-20  |  34.6 KB  |  1,060 lines  |  [TEXT/KAHL]

  1. /***************************************************************************
  2.  
  3.     TileHack, an FKEY
  4.     
  5.     A Hack that changed, and changed again. This hack is now called 
  6.      You Got No Fonts, You Skanky Programmer
  7.      
  8.     This hack uses the concept of the FKEY as a way to quickly change
  9.     your reality. Think dose, think FKEY.
  10.     
  11.     We actually use NO RESOURCES. This is essential to the self-contained
  12.     hack FKEY 'You Got No Fonts, You Skanky Programmer'.
  13.     
  14.     We want a very cool Window, made from the very stuff of code itself,
  15.     LetterForm. So we take Outline fonts, make a Picture, turn it into 
  16.     a RegionHandle with an offscreen port, write it to a resource, turn
  17.     the resource into a buncha DC.W's (the skanky programmers friend)
  18.     and embed them into the CODE itself (like the old days). ALL  
  19.     creation code is in the FKEY, toggled by a compile-time flag.
  20.     
  21.     When we fire off the FKEY, we make a window, invisible, BlockMove the
  22.     WDEF code, STUFF the windowProc, ShowWindow and leave the scene of the crime.
  23.     
  24.     Don't try this at home, You Skanky Programmer   (NOT!  :-)
  25.     
  26.     B. Marshall Hamlin
  27.     Constructor
  28.     Noesis Sfwr Construction
  29.     
  30.     ALink: D0781
  31.     6300 Leona St
  32.     Oakland, CA  94605-1228
  33.     
  34. ***************************************************************************/
  35.                                                 //   I N C L U D E
  36. //include "LoMem.ph"
  37. #include <LoMem.h>
  38. #include <Resources.h>
  39. #include <Palettes.h>
  40.  
  41.  
  42. //*************************************************************************
  43.                                                 //   F O R W A R D
  44.  
  45. pascal void FlushCodeCache (void) = 0xA0BD;
  46.  
  47. pascal long HackWindow (short varCode, WindowPeek theWindow, short message, long param);
  48.  
  49. void dataShortProc(void);
  50. void endShortData(void);
  51.  
  52. void dataLongProc(void);
  53. void endLongData(void);
  54.  
  55. void DrawHackCont(void);
  56. void MakeRgnBg(void);
  57. RgnHandle PICT2Rgn( PicHandle p );
  58. BitMap *PICT2BitMap( PicHandle p );
  59. Boolean CreateOffscreenBitMap(GrafPtr *newOffscreen, Rect *inBounds);
  60. void DestroyOffscreenBitMap(GrafPtr oldOffscreen);
  61.  
  62.  
  63.  
  64. //*************************************************************************
  65.                                                 //   C O N S T A N T S
  66.                                                 
  67. #define kWinLongHdrHt    98
  68. #define kWinLongWid        502
  69. #define kWinLongHt        (407-kWinHdrHt)
  70.  
  71. #define kWinShortHdrHt    96
  72. #define kWinShortWid    275
  73.  
  74.  
  75. typedef struct  {
  76.     char privates[76];
  77.     long randSeed;
  78.     BitMap screenBits;
  79.     Cursor arrow;
  80.     Pattern dkGray;
  81.     Pattern ltGray;
  82.     Pattern gray;
  83.     Pattern black;
  84.     Pattern white;
  85.     GrafPtr thePort;
  86. }QD;
  87.  
  88.  
  89. //*************************************************************************
  90.                                                 //   F L A G S
  91.  
  92. #define MAKE_RGN        0
  93.  
  94.  
  95. //*************************************************************************
  96.                                                 //   M A I N 
  97. main()
  98. {
  99.     SysEnvRec        environs;
  100.     GrafPtr            savPort;
  101.     
  102.     QD                *qdG;
  103.     
  104.     OSErr            err;
  105.     WindowPeek        thWinPtr;
  106.     Ptr                wdefProcPtr;
  107.     Rect            bounds;
  108.     short            off1, off2;
  109.     unsigned long    prevA5;
  110.     long            procSize;
  111.     struct        {    short jmp ;
  112.                     ProcPtr addr ;} **wdefHdl;
  113.  
  114.     // *************************************************************
  115.     //  Insert a set of routines to build the Window Region
  116.  
  117.     if ( MAKE_RGN) {
  118.         MakeRgnBg();
  119.         return;
  120.     }
  121.     
  122.     // *************************************************************
  123.     //  Check for color (make one in B&W, later)
  124.     
  125.     err = SysEnvirons( 1, &environs);
  126.     if (err != noErr || !environs.hasColorQD)
  127.         return;
  128.  
  129.  
  130.     // *************************************************************
  131.     // Decide how big our display window is here
  132.     // Should we:
  133.     //        make it a fixed size?
  134.     //        search monitors, find a good one, calc size and put it there?
  135.     
  136.     bounds.top = (**GrayRgn).rgnBBox.top + MBarHeight + 2;
  137.     bounds.left = (**GrayRgn).rgnBBox.left + 2;
  138.     bounds.right = bounds.left + kWinShortWid;
  139.     bounds.bottom = bounds.top + kWinShortHdrHt;        // + kWinHt;
  140.  
  141.     off1 = Random();    off1 = off1 & 0x001f;
  142.     off2 = Random();    off2 = off2 & 0x001f;
  143.     
  144.     OffsetRect( &bounds, off1, off2);
  145.  
  146.     // *************************************************************
  147.     //  Make the window here. Make it invisible, so we can stuff
  148.     //  the WDEF. We could just pass a WDEF resId, but this is an 
  149.     //    FKEY so we want to keep it _completely_ self-contained.
  150.     
  151.     GetPort( &savPort);
  152.     thWinPtr = NewCWindow( nil, &bounds, "", false, 0, (void*)-1, true, 0L);
  153.     procSize = (long)((Ptr)endLongData - (Ptr)HackWindow);    // src dependent
  154.  
  155.     wdefHdl = NewHandle( procSize);
  156.     BlockMove( (Ptr)HackWindow, *wdefHdl, procSize);
  157.     
  158.     if (CPUFlag >= 2)                        // programmers have 040's
  159.         FlushCodeCache();
  160.     thWinPtr->windowDefProc = wdefHdl;
  161.     ShowWindow( thWinPtr);
  162.  
  163.  
  164.     // *************************************************************
  165.     //  A5 Lore - it turns out that calling an FKEY under System VII
  166.     //  is done in such a way that moving from CurrentA5 is *not*
  167.     //  good enough to allow drawing. (the following code won't let
  168.     //  us draw)  Neither will just drawing after the SetPort() for 
  169.     //  matter...
  170.     //  
  171.     //asm {
  172.     //    movea.l        CurrentA5,A5
  173.     //};
  174.     
  175.     // *************************************************************
  176.     //  SO what we do is allocate a quickdraw globals space on the
  177.     //  heap and call _InitGraf, thereby letting us do our drawing!    
  178.     //  Be sure to save the OLD A5 and restore it to keep the world
  179.     //  in line.
  180.     //  CALLER BEWARE: since InitGraf fills storage from the *bottom
  181.     //  up*, we have to allocate a Ptr the right size & pass a Ptr to 
  182.     //  the port at the *bottom*.                    (thanks to sp)
  183.  
  184. #if(1)
  185.     if ( (qdG = NewPtr( sizeof(QD))) != 0) {
  186.         asm {
  187.             move.l        a5,prevA5
  188.         };
  189.         InitGraf( &qdG->thePort);
  190.         SetPort( thWinPtr);
  191.         DrawHackCont();
  192.         asm {
  193.             move.l        prevA5,a5
  194.         };
  195.         SetPort( savPort);
  196.         DisposPtr( qdG);
  197.     }
  198. #else
  199.     SetPort( savPort);
  200. #endif
  201.     
  202.     // *************************************************************
  203.     //  Ditch the window ? or leave it around... TBD
  204.     //  (different apps will respond in different ways to having an
  205.     //  alien window around) 
  206.     
  207.     if ( 0) {
  208.         while (!Button())
  209.             ;
  210.     
  211.         SetPort( savPort);
  212.         DisposeWindow( thWinPtr);
  213.         DisposeHandle( wdefHdl);
  214.     }
  215.     
  216.     
  217. }
  218.  
  219. #if(0)
  220.     // *************************************************************
  221.     //  Old way. Make a Ptr, stuff the WDEF, make a handle,
  222.     //  stuff a JMP and Ptr address (don't ask me, I just
  223.     //  made it work!)
  224.     
  225.     wdefProcPtr = NewPtr(procSize);
  226.     BlockMove( (Ptr)HackWindow, wdefProcPtr, procSize);
  227.     
  228.     wdefHdl = NewHandle (sizeof(**wdefHdl));
  229.     
  230.     (**wdefHdl).jmp = 0x4EF9;
  231.     (**wdefHdl).addr = wdefProcPtr;        
  232.     
  233.     // Before that, I used the code *in* the FKEY, but that's
  234.     // bad 'cause the FKEY will be moved/purged after you die..
  235.     //(**wdefHdl).addr = &HackWindow;
  236. #endif
  237.  
  238.  
  239.  
  240. //*************************************************************************
  241. //        WDEF here.     
  242. //*************************************************************************
  243. #define kNoGrowVar    1
  244.  
  245. pascal long HackWindow( short varCode, WindowPeek theWindow, short message, long param)
  246. {    
  247.     Handle            h, h2;
  248.     Boolean            growable;
  249.     Rect            r, bitsR;
  250.     Point            pt;
  251.     long            dataSize;
  252.     CGrafPtr        cGrafPtr;
  253.     GrafPtr            savPort;
  254.     
  255.     RGBColor    tC;
  256.     Pattern        blk = { 0,0,0,0,0,0,0,0};
  257.     Pattern        wht = { 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff};
  258.     Pattern        gr  = { 0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55};
  259.  
  260.     
  261.     growable = (varCode != kNoGrowVar);
  262.  
  263.     switch (message) {
  264.     
  265.         case wDraw:
  266.             // ************************************************************
  267.             //                                                  DRAW
  268.             //   check the visible flag. If not visible, forget it!
  269.  
  270.             if ( !theWindow->visible)
  271.                 return;
  272.  
  273.             // ************************************************************
  274.             //   Next, check the value of param
  275.             //
  276.             //        0        Draw entire window frame
  277.             //                    check hilite
  278.             //                    check goAway flag in window record
  279.             //                    check growable flag
  280.             //        4        Handle goAway 
  281.             //
  282.             //    Note that drawing is clipped to the structure rgn
  283.             //
  284.             
  285.             if ( param == 4) {
  286.                 // no go away right now
  287.                 break;
  288.             }
  289.             
  290.             
  291. #if(1)
  292.             //PenPat( gr);
  293.             
  294.             GetPort( &savPort);                
  295.             GetCWMgrPort( &cGrafPtr);    // Most Necessary to draw in color
  296.             SetPort( cGrafPtr);
  297.             PenNormal();
  298.             
  299.             tC.red = Random();            //0x4400;
  300.             tC.green = 0x0000;
  301.             tC.blue = 0x0000;
  302.             RGBForeColor( &tC);
  303.             PaintRgn( theWindow->strucRgn);
  304.             
  305.             ForeColor( blackColor);
  306.             FrameRgn( theWindow->strucRgn);
  307.             FrameRect( &(**theWindow->contRgn).rgnBBox);
  308.             
  309.             BackColor( whiteColor);
  310.             EraseRgn( theWindow->contRgn);
  311.             
  312.             if ( theWindow->hilited) {
  313.                 Rect        r;
  314.                 short        hL;
  315.                 short        curPen;
  316.                 long        indC[ 20] = {0,1,2,3,4,5,6,12,18,24,30,215,71,218,220,221,222,223,255};
  317.                 short        *clutPtr;        // ditch the type stuff
  318.                 
  319.                 // interesting indexes in the system clut
  320.                 // 0,1,2,3,4,5,6,12,18,24,30,215,71,218,220,221,222,223,255
  321.                                 
  322.                 //DebugStr("\p;thecport");
  323.  
  324.                 //tC.red = 0x4400;
  325.                 //tC.green = 0x0000;
  326.                 //tC.blue = 0x0000;
  327.                 //RGBForeColor( &tC);
  328.                 //PaintRgn( theWindow->strucRgn);
  329.  
  330.                 if(0) {
  331.                     // ********************************************************
  332.                     //  We want to draw in nice colors. Send this to me later!
  333.                 
  334.                     r = (**theWindow->strucRgn).rgnBBox;
  335.                     curPen = 2;
  336.                     PenSize( curPen, curPen);
  337.  
  338.                     clutPtr = &(**(**cGrafPtr->portPixMap).pmTable).ctTable;
  339.                     Debugger();
  340.  
  341.                     for( hL=0; hL<20; hL++) {
  342.                     
  343.                         Index2Color( indC[hL], &tC);
  344.                         
  345.                         //tC.red        = clutPtr[ indC[hL]+1];
  346.                         //tC.green        = clutPtr[ indC[hL]+2];
  347.                         //tC.blue        = clutPtr[ indC[hL]+3];
  348.                         
  349.                         RGBForeColor( &tC);
  350.                         MoveTo( r.left+4, r.top+58+hL*curPen);
  351.                         Line( r.right-r.left-8, 0);
  352.                         MoveTo( r.left+4, r.top+58-hL*curPen);
  353.                         Line( r.right-r.left-8, 0);
  354.                     }
  355.                     
  356.                     //PenMode( patBic);
  357.                     
  358.                     //h2 = NewHandle( 0);
  359.                     //HandAndHand( theWindow->strucRgn, h2);
  360.                     //InsetRgn( (RgnHandle)h2, -2, -2);
  361.                     //PaintRgn( (RgnHandle)h2);
  362.                 }
  363.                 
  364.             } else if ( growable) {
  365.             }
  366. #else
  367.             r = (**theWindow->strucRgn).rgnBBox;
  368.             FrameRect( &r);
  369. #endif
  370.             ForeColor( blackColor);
  371.             PenNormal();
  372.             SetPort( savPort);
  373.             
  374.             break;
  375.  
  376.  
  377.         case wHit:
  378.             // ************************************************************
  379.             //                                              HIT
  380.             
  381.             pt.v = (param & 0xFFFF0000) >> 0x10;
  382.             pt.h = param & 0x0000FFFF;
  383.             GlobalToLocal( &pt);
  384.             
  385.             if ( pt.v < kWinShortHdrHt)
  386.                 return wInDrag;
  387.                 
  388.             //Debugger();
  389.             if ( PtInRgn( pt, theWindow->contRgn))
  390.                 return wInContent;
  391.             
  392.             return wInGrow;
  393.             return wNoHit;
  394.             break;
  395.  
  396.  
  397.         case wCalcRgns:
  398.             // ************************************************************
  399.             //                                              CALC REGIONS
  400.  
  401.             // get our pre-calc'd region, stuff it and go
  402.             
  403.             dataSize = (long)((Ptr)endShortData - (Ptr)dataShortProc);
  404.             h = NewHandle( dataSize);
  405.             BlockMove( (Ptr)dataShortProc, *h, dataSize);
  406.             
  407.             r = theWindow->port.portRect;
  408.             if ( (*(CWindowRecord*)theWindow).port.portVersion < 0)  
  409.                 bitsR = (**(*(CWindowRecord*)theWindow).port.portPixMap).bounds;
  410.             else
  411.                 bitsR = theWindow->port.portBits.bounds;
  412.  
  413.             DisposeRgn( theWindow->strucRgn);
  414.             OffsetRgn( (RgnHandle)h, -bitsR.left, -bitsR.top);
  415.             theWindow->strucRgn = (RgnHandle)h;
  416.             
  417.             OffsetRect( &r, -bitsR.left, -bitsR.top);
  418.             r.top += kWinShortHdrHt;
  419.             r.left += 3;
  420.             r.right -= 2;
  421.             r.bottom -= 2;
  422.             OpenRgn();
  423.             FrameRect(&r);
  424.             CloseRgn( theWindow->contRgn);
  425.     
  426.             break;
  427.  
  428.  
  429.         case wNew:
  430.             // ************************************************************
  431.             //                                              NEW
  432.             break;
  433.         
  434.         case wDispose:
  435.             // ************************************************************
  436.             //                                              DISPOSE
  437.             break;
  438.         
  439.         case wGrow:
  440.             // ************************************************************
  441.             //                                              GROW
  442.             if ( growable) {
  443.                 ;
  444.             }
  445.             break;
  446.         
  447.         case wDrawGIcon:
  448.             // ************************************************************
  449.             //                                              DRAW GROW ICON
  450.             break;
  451.         
  452.         default:
  453.             break;
  454.     };
  455. }
  456.  
  457.  
  458. /********************************************************************************
  459.   dataShortProc
  460.  
  461.           Window with no content rgn
  462.  
  463. *********************************************************************************/
  464.  
  465. void dataShortProc() 
  466. {
  467.     asm {
  468.         dc.w 0x07F0,0x0000,0x0000,0x0060,0x0113,0x0000
  469.         dc.w 0x005A,0x0064,0x00A7,0x00AD,0x7FFF,0x0001
  470.         dc.w 0x0053,0x005A,0x0064,0x006A,0x009E,0x00A7
  471.         dc.w 0x00AD,0x00B6,0x7FFF,0x0002,0x0050,0x0053
  472.         dc.w 0x006A,0x006E,0x009A,0x009E,0x00B6,0x00B9
  473.         dc.w 0x7FFF,0x0003,0x004C,0x0050,0x006E,0x0071
  474.         dc.w 0x0097,0x009A,0x00B9,0x00BC,0x7FFF,0x0004
  475.         dc.w 0x004B,0x004C,0x0071,0x0073,0x0094,0x0097
  476.         dc.w 0x00BC,0x00BE,0x7FFF,0x0005,0x0049,0x004B
  477.         dc.w 0x0073,0x0075,0x0092,0x0094,0x00BE,0x00C0
  478.         dc.w 0x7FFF,0x0006,0x0047,0x0049,0x0075,0x0077
  479.         dc.w 0x0090,0x0092,0x00C0,0x00C2,0x7FFF,0x0007
  480.         dc.w 0x0045,0x0047,0x0077,0x0078,0x008E,0x0090
  481.         dc.w 0x00C2,0x00C3,0x7FFF,0x0008,0x0044,0x0045
  482.         dc.w 0x0078,0x0079,0x008D,0x008E,0x00C3,0x00C4
  483.         dc.w 0x7FFF,0x0009,0x0043,0x0044,0x0079,0x007A
  484.         dc.w 0x008B,0x008D,0x00C4,0x00C5,0x7FFF,0x000A
  485.         dc.w 0x0042,0x0043,0x007A,0x007C,0x008A,0x008B
  486.         dc.w 0x00C5,0x00C6,0x7FFF,0x000B,0x0041,0x0042
  487.         dc.w 0x0089,0x008A,0x00C6,0x00C7,0x7FFF,0x000C
  488.         dc.w 0x0040,0x0041,0x005C,0x0061,0x007C,0x007D
  489.         dc.w 0x0087,0x0089,0x00C7,0x00C8,0x7FFF,0x000D
  490.         dc.w 0x005A,0x005C,0x0061,0x0063,0x007D,0x007E
  491.         dc.w 0x0087,0x0088,0x7FFF,0x000E,0x003F,0x0040
  492.         dc.w 0x0059,0x005A,0x0063,0x0064,0x007E,0x007F
  493.         dc.w 0x0088,0x0089,0x00C8,0x00C9,0x7FFF,0x000F
  494.         dc.w 0x003E,0x003F,0x0058,0x0059,0x0064,0x0066
  495.         dc.w 0x007F,0x0080,0x7FFF,0x0010,0x003D,0x003E
  496.         dc.w 0x0057,0x0058,0x0066,0x0067,0x0089,0x008A
  497.         dc.w 0x00C9,0x00CA,0x7FFF,0x0011,0x0080,0x0081
  498.         dc.w 0x008A,0x008B,0x009F,0x00A7,0x7FFF,0x0012
  499.         dc.w 0x003C,0x003D,0x0056,0x0057,0x0067,0x0068
  500.         dc.w 0x009D,0x009F,0x00A7,0x00AA,0x7FFF,0x0013
  501.         dc.w 0x0081,0x0082,0x008B,0x008C,0x009A,0x009D
  502.         dc.w 0x00AA,0x00AB,0x7FFF,0x0014,0x003B,0x003C
  503.         dc.w 0x0068,0x0069,0x008C,0x008D,0x0098,0x009A
  504.         dc.w 0x00AB,0x00AC,0x7FFF,0x0015,0x0055,0x0056
  505.         dc.w 0x0082,0x0083,0x0097,0x0098,0x00AC,0x00AD
  506.         dc.w 0x00CA,0x00CB,0x7FFF,0x0016,0x008D,0x008E
  507.         dc.w 0x0095,0x0097,0x7FFF,0x0017,0x003A,0x003B
  508.         dc.w 0x008E,0x008F,0x0093,0x0095,0x00AD,0x00AE
  509.         dc.w 0x7FFF,0x0018,0x0054,0x0055,0x0083,0x0084
  510.         dc.w 0x0092,0x0093,0x7FFF,0x0019,0x0069,0x006A
  511.         dc.w 0x008F,0x0092,0x7FFF,0x001A,0x00CA,0x00CB
  512.         dc.w 0x7FFF,0x001B,0x0039,0x003A,0x7FFF,0x001D
  513.         dc.w 0x0084,0x0085,0x7FFF,0x001F,0x00AD,0x00AE
  514.         dc.w 0x7FFF,0x0020,0x00C9,0x00CA,0x7FFF,0x0022
  515.         dc.w 0x00AC,0x00AD,0x00C8,0x00C9,0x7FFF,0x0024
  516.         dc.w 0x0054,0x0055,0x0069,0x006A,0x0084,0x0085
  517.         dc.w 0x00AB,0x00AC,0x00C7,0x00C8,0x7FFF,0x0025
  518.         dc.w 0x0039,0x003A,0x7FFF,0x0026,0x0055,0x0056
  519.         dc.w 0x00AA,0x00AB,0x7FFF,0x0027,0x003A,0x003B
  520.         dc.w 0x0068,0x0069,0x00C6,0x00C7,0x7FFF,0x0028
  521.         dc.w 0x00A9,0x00AA,0x00C5,0x00C6,0x7FFF,0x0029
  522.         dc.w 0x0056,0x0057,0x0067,0x0068,0x00A8,0x00A9
  523.         dc.w 0x7FFF,0x002A,0x003B,0x003C,0x0057,0x0058
  524.         dc.w 0x00C4,0x00C5,0x7FFF,0x002B,0x003C,0x003D
  525.         dc.w 0x0058,0x0059,0x0066,0x0067,0x00A7,0x00A8
  526.         dc.w 0x00C3,0x00C4,0x7FFF,0x002C,0x0059,0x005A
  527.         dc.w 0x0064,0x0066,0x0083,0x0084,0x00A6,0x00A7
  528.         dc.w 0x7FFF,0x002D,0x003D,0x003E,0x005A,0x005D
  529.         dc.w 0x0061,0x0064,0x00C2,0x00C3,0x7FFF,0x002E
  530.         dc.w 0x003E,0x003F,0x005D,0x0061,0x00A5,0x00A6
  531.         dc.w 0x00C1,0x00C2,0x7FFF,0x002F,0x003F,0x0040
  532.         dc.w 0x0082,0x0083,0x00A4,0x00A5,0x00C0,0x00C1
  533.         dc.w 0x7FFF,0x0030,0x0040,0x0041,0x00A3,0x00A4
  534.         dc.w 0x7FFF,0x0031,0x0041,0x0042,0x00A2,0x00A3
  535.         dc.w 0x00BF,0x00C0,0x7FFF,0x0032,0x0000,0x0007
  536.         dc.w 0x000E,0x0015,0x001E,0x0022,0x002E,0x0033
  537.         dc.w 0x0042,0x0043,0x0081,0x0082,0x00A1,0x00A2
  538.         dc.w 0x00BE,0x00BF,0x00D1,0x00D6,0x00DC,0x00E1
  539.         dc.w 0x00E8,0x00ED,0x00F9,0x00FE,0x0103,0x0108
  540.         dc.w 0x010C,0x0112,0x7FFF,0x0033,0x0007,0x0008
  541.         dc.w 0x001D,0x001E,0x002C,0x002E,0x0033,0x0035
  542.         dc.w 0x0043,0x0045,0x00BD,0x00BE,0x00F7,0x00F9
  543.         dc.w 0x00FE,0x0100,0x010B,0x010C,0x0111,0x0112
  544.         dc.w 0x7FFF,0x0034,0x000D,0x000E,0x0022,0x0023
  545.         dc.w 0x002B,0x002C,0x0035,0x0036,0x0045,0x0046
  546.         dc.w 0x0080,0x0081,0x00A0,0x00A1,0x00BC,0x00BD
  547.         dc.w 0x00ED,0x00EE,0x00F6,0x00F7,0x0100,0x0101
  548.         dc.w 0x0110,0x0111,0x7FFF,0x0035,0x001C,0x001D
  549.         dc.w 0x002A,0x002B,0x0046,0x0048,0x009F,0x00A0
  550.         dc.w 0x00BB,0x00BC,0x00E7,0x00E8,0x00F5,0x00F6
  551.         dc.w 0x010A,0x010B,0x010F,0x0110,0x7FFF,0x0036
  552.         dc.w 0x0008,0x0009,0x0029,0x002A,0x002F,0x0036
  553.         dc.w 0x0048,0x004B,0x007F,0x0080,0x009E,0x009F
  554.         dc.w 0x00BA,0x00BB,0x00F4,0x00F5,0x00FA,0x0101
  555.         dc.w 0x010E,0x010F,0x7FFF,0x0037,0x000C,0x000D
  556.         dc.w 0x0023,0x0024,0x002E,0x002F,0x004B,0x004E
  557.         dc.w 0x009D,0x009E,0x00B9,0x00BA,0x00EE,0x00EF
  558.         dc.w 0x00F9,0x00FA,0x0109,0x010A,0x7FFF,0x0038
  559.         dc.w 0x001B,0x001C,0x001E,0x0020,0x0028,0x0029
  560.         dc.w 0x002D,0x002E,0x004E,0x0052,0x0060,0x0064
  561.         dc.w 0x007E,0x007F,0x009C,0x009D,0x00B8,0x00B9
  562.         dc.w 0x00D6,0x00DC,0x00E6,0x00E7,0x00E9,0x00EB
  563.         dc.w 0x00F3,0x00F4,0x00F8,0x00F9,0x0108,0x0109
  564.         dc.w 0x010D,0x010E,0x7FFF,0x0039,0x0004,0x0005
  565.         dc.w 0x0009,0x000A,0x000F,0x0010,0x0052,0x0060
  566.         dc.w 0x009B,0x009C,0x010C,0x010D,0x7FFF,0x003A
  567.         dc.w 0x000B,0x000C,0x001A,0x001B,0x001D,0x001E
  568.         dc.w 0x0024,0x0025,0x0063,0x0064,0x007D,0x007E
  569.         dc.w 0x009A,0x009B,0x00B7,0x00B8,0x00E5,0x00E6
  570.         dc.w 0x00EF,0x00F0,0x010C,0x010D,0x7FFF,0x003B
  571.         dc.w 0x0005,0x0006,0x0020,0x0021,0x007C,0x007D
  572.         dc.w 0x0099,0x009A,0x00B6,0x00B7,0x00D6,0x00DC
  573.         dc.w 0x00E8,0x00E9,0x00EB,0x00EC,0x010D,0x010E
  574.         dc.w 0x7FFF,0x003C,0x000A,0x000B,0x000E,0x000F
  575.         dc.w 0x001D,0x0021,0x0025,0x0026,0x0028,0x0029
  576.         dc.w 0x0062,0x0063,0x0098,0x0099,0x00B5,0x00B6
  577.         dc.w 0x00E8,0x00EC,0x00F0,0x00F1,0x00F3,0x00F4
  578.         dc.w 0x0108,0x0109,0x7FFF,0x003D,0x0019,0x001A
  579.         dc.w 0x002D,0x002E,0x0061,0x0062,0x007B,0x007C
  580.         dc.w 0x0097,0x0098,0x00B4,0x00B5,0x00E4,0x00E5
  581.         dc.w 0x00F8,0x00F9,0x0109,0x010A,0x010E,0x010F
  582.         dc.w 0x7FFF,0x003E,0x0006,0x0007,0x000D,0x000E
  583.         dc.w 0x002E,0x002F,0x007A,0x007B,0x0096,0x0097
  584.         dc.w 0x00B3,0x00B4,0x00F9,0x00FA,0x010F,0x0110
  585.         dc.w 0x7FFF,0x003F,0x0018,0x0019,0x001C,0x0022
  586.         dc.w 0x0026,0x0027,0x0029,0x002A,0x002F,0x0036
  587.         dc.w 0x0060,0x0061,0x0095,0x0096,0x00B2,0x00B3
  588.         dc.w 0x00E3,0x00E4,0x00E7,0x00ED,0x00F1,0x00F2
  589.         dc.w 0x00F4,0x00F5,0x00FA,0x0101,0x010A,0x010B
  590.         dc.w 0x0110,0x0111,0x7FFF,0x0040,0x002A,0x002B
  591.         dc.w 0x005F,0x0060,0x0079,0x007A,0x0094,0x0095
  592.         dc.w 0x00B1,0x00B2,0x00F5,0x00F6,0x7FFF,0x0041
  593.         dc.w 0x0007,0x0008,0x000C,0x000D,0x001B,0x001C
  594.         dc.w 0x0022,0x0023,0x0027,0x0028,0x002B,0x002C
  595.         dc.w 0x005E,0x005F,0x0078,0x0079,0x0093,0x0094
  596.         dc.w 0x00B0,0x00B1,0x00E6,0x00E7,0x00F6,0x00F7
  597.         dc.w 0x010B,0x010C,0x0111,0x0112,0x7FFF,0x0042
  598.         dc.w 0x0017,0x0018,0x002C,0x002E,0x0034,0x0036
  599.         dc.w 0x005D,0x005E,0x0077,0x0078,0x0092,0x0093
  600.         dc.w 0x00AF,0x00B0,0x00E2,0x00E3,0x00ED,0x00EE
  601.         dc.w 0x00F2,0x00F3,0x00F7,0x00F9,0x00FF,0x0101
  602.         dc.w 0x010C,0x010D,0x0112,0x0113,0x7FFF,0x0043
  603.         dc.w 0x0000,0x0004,0x0008,0x000C,0x0010,0x0015
  604.         dc.w 0x0017,0x001B,0x0023,0x0028,0x002E,0x0034
  605.         dc.w 0x005C,0x005D,0x0076,0x0077,0x0091,0x0092
  606.         dc.w 0x00AE,0x00AF,0x00D1,0x00D6,0x00DC,0x00E1
  607.         dc.w 0x00E2,0x00E6,0x00EE,0x00F3,0x00F9,0x00FF
  608.         dc.w 0x0103,0x0108,0x010D,0x0113,0x7FFF,0x0044
  609.         dc.w 0x005B,0x005C,0x0075,0x0076,0x0090,0x0091
  610.         dc.w 0x00AD,0x00AE,0x7FFF,0x0045,0x005A,0x005B
  611.         dc.w 0x0074,0x0075,0x008F,0x0090,0x00AC,0x00AD
  612.         dc.w 0x7FFF,0x0046,0x0058,0x005A,0x0073,0x0074
  613.         dc.w 0x008E,0x008F,0x00AB,0x00AC,0x7FFF,0x0047
  614.         dc.w 0x0057,0x0058,0x0072,0x0073,0x008D,0x008E
  615.         dc.w 0x00AA,0x00AB,0x7FFF,0x0048,0x0055,0x0057
  616.         dc.w 0x0071,0x0072,0x008C,0x008D,0x00A9,0x00AA
  617.         dc.w 0x7FFF,0x0049,0x0054,0x0055,0x0070,0x0071
  618.         dc.w 0x008A,0x008C,0x00A9,0x00CC,0x7FFF,0x004A
  619.         dc.w 0x0052,0x0054,0x006F,0x0070,0x0089,0x008A
  620.         dc.w 0x7FFF,0x004B,0x0050,0x0052,0x006E,0x006F
  621.         dc.w 0x0088,0x0089,0x7FFF,0x004C,0x004E,0x0050
  622.         dc.w 0x006C,0x006E,0x0087,0x0088,0x7FFF,0x004D
  623.         dc.w 0x004C,0x004E,0x006B,0x006C,0x0086,0x0087
  624.         dc.w 0x7FFF,0x004E,0x0049,0x004C,0x0069,0x006B
  625.         dc.w 0x0085,0x0086,0x7FFF,0x004F,0x0045,0x0049
  626.         dc.w 0x0068,0x0069,0x0084,0x0085,0x7FFF,0x0050
  627.         dc.w 0x0041,0x0045,0x0067,0x0068,0x7FFF,0x0051
  628.         dc.w 0x0065,0x0067,0x7FFF,0x0052,0x0063,0x0065
  629.         dc.w 0x7FFF,0x0053,0x0061,0x0063,0x7FFF,0x0054
  630.         dc.w 0x005F,0x0061,0x7FFF,0x0055,0x005D,0x005F
  631.         dc.w 0x7FFF,0x0056,0x005B,0x005D,0x7FFF,0x0057
  632.         dc.w 0x0058,0x005B,0x7FFF,0x0058,0x0055,0x0058
  633.         dc.w 0x7FFF,0x0059,0x0052,0x0055,0x7FFF,0x005A
  634.         dc.w 0x004F,0x0052,0x7FFF,0x005B,0x004F,0x0084
  635.         dc.w 0x7FFF,0x005C,0x004A,0x0084,0x7FFF,0x005D
  636.         dc.w 0x004A,0x0084,0x7FFF,0x0060,0x0041,0x00CC
  637.         dc.w 0x7FFF,0x7FFF
  638.     };
  639. }
  640.  
  641. void endShortData()
  642. {
  643.     ;
  644. }
  645.  
  646.  
  647. /********************************************************************************
  648.   dataLongProc
  649.   
  650.           Window with a content rgn
  651.           
  652. *********************************************************************************/
  653.  
  654. void dataLongProc() 
  655. {
  656.     asm {
  657.         dc.w 0x0824,0x0000,0x0000,0x005F,0x01F7,0x0000
  658.         dc.w 0x00CA,0x00D4,0x0117,0x011D,0x7FFF,0x0001
  659.         dc.w 0x00C3,0x00CA,0x00D4,0x00DA,0x010E,0x0117
  660.         dc.w 0x011D,0x0126,0x7FFF,0x0002,0x00C0,0x00C3
  661.         dc.w 0x00DA,0x00DE,0x010A,0x010E,0x0126,0x0129
  662.         dc.w 0x7FFF,0x0003,0x00BC,0x00C0,0x00DE,0x00E1
  663.         dc.w 0x0107,0x010A,0x0129,0x012C,0x7FFF,0x0004
  664.         dc.w 0x00BB,0x00BC,0x00E1,0x00E3,0x0104,0x0107
  665.         dc.w 0x012C,0x012E,0x7FFF,0x0005,0x00B9,0x00BB
  666.         dc.w 0x00E3,0x00E5,0x0102,0x0104,0x012E,0x0130
  667.         dc.w 0x7FFF,0x0006,0x00B7,0x00B9,0x00E5,0x00E7
  668.         dc.w 0x0100,0x0102,0x0130,0x0132,0x7FFF,0x0007
  669.         dc.w 0x00B5,0x00B7,0x00E7,0x00E8,0x00FE,0x0100
  670.         dc.w 0x0132,0x0133,0x7FFF,0x0008,0x00B4,0x00B5
  671.         dc.w 0x00E8,0x00E9,0x00FD,0x00FE,0x0133,0x0134
  672.         dc.w 0x7FFF,0x0009,0x00B3,0x00B4,0x00E9,0x00EA
  673.         dc.w 0x00FB,0x00FD,0x0134,0x0135,0x7FFF,0x000A
  674.         dc.w 0x00B2,0x00B3,0x00EA,0x00EC,0x00FA,0x00FB
  675.         dc.w 0x0135,0x0136,0x7FFF,0x000B,0x00B1,0x00B2
  676.         dc.w 0x00F9,0x00FA,0x0136,0x0137,0x7FFF,0x000C
  677.         dc.w 0x00B0,0x00B1,0x00CC,0x00D1,0x00EC,0x00ED
  678.         dc.w 0x00F7,0x00F9,0x0137,0x0138,0x7FFF,0x000D
  679.         dc.w 0x00CA,0x00CC,0x00D1,0x00D3,0x00ED,0x00EE
  680.         dc.w 0x00F7,0x00F8,0x7FFF,0x000E,0x00AF,0x00B0
  681.         dc.w 0x00C9,0x00CA,0x00D3,0x00D4,0x00EE,0x00EF
  682.         dc.w 0x00F8,0x00F9,0x0138,0x0139,0x7FFF,0x000F
  683.         dc.w 0x00AE,0x00AF,0x00C8,0x00C9,0x00D4,0x00D6
  684.         dc.w 0x00EF,0x00F0,0x7FFF,0x0010,0x00AD,0x00AE
  685.         dc.w 0x00C7,0x00C8,0x00D6,0x00D7,0x00F9,0x00FA
  686.         dc.w 0x0139,0x013A,0x7FFF,0x0011,0x00F0,0x00F1
  687.         dc.w 0x00FA,0x00FB,0x010F,0x0117,0x7FFF,0x0012
  688.         dc.w 0x00AC,0x00AD,0x00C6,0x00C7,0x00D7,0x00D8
  689.         dc.w 0x010D,0x010F,0x0117,0x011A,0x7FFF,0x0013
  690.         dc.w 0x00F1,0x00F2,0x00FB,0x00FC,0x010A,0x010D
  691.         dc.w 0x011A,0x011B,0x7FFF,0x0014,0x00AB,0x00AC
  692.         dc.w 0x00D8,0x00D9,0x00FC,0x00FD,0x0108,0x010A
  693.         dc.w 0x011B,0x011C,0x7FFF,0x0015,0x00C5,0x00C6
  694.         dc.w 0x00F2,0x00F3,0x0107,0x0108,0x011C,0x011D
  695.         dc.w 0x013A,0x013B,0x7FFF,0x0016,0x00FD,0x00FE
  696.         dc.w 0x0105,0x0107,0x7FFF,0x0017,0x00AA,0x00AB
  697.         dc.w 0x00FE,0x00FF,0x0103,0x0105,0x011D,0x011E
  698.         dc.w 0x7FFF,0x0018,0x00C4,0x00C5,0x00F3,0x00F4
  699.         dc.w 0x0102,0x0103,0x7FFF,0x0019,0x00D9,0x00DA
  700.         dc.w 0x00FF,0x0102,0x7FFF,0x001A,0x013A,0x013B
  701.         dc.w 0x7FFF,0x001B,0x00A9,0x00AA,0x7FFF,0x001D
  702.         dc.w 0x00F4,0x00F5,0x7FFF,0x001F,0x011D,0x011E
  703.         dc.w 0x7FFF,0x0020,0x0139,0x013A,0x7FFF,0x0021
  704.         dc.w 0x0000,0x00A9,0x00C4,0x00DA,0x00F5,0x011D
  705.         dc.w 0x0139,0x01F7,0x7FFF,0x0022,0x0001,0x00A9
  706.         dc.w 0x00C4,0x00DA,0x00F5,0x011C,0x0138,0x01F6
  707.         dc.w 0x7FFF,0x0023,0x0002,0x00A9,0x00C4,0x00DA
  708.         dc.w 0x00F5,0x011C,0x0138,0x01F5,0x7FFF,0x0025
  709.         dc.w 0x0004,0x00AA,0x00C5,0x00D9,0x00F4,0x011B
  710.         dc.w 0x0137,0x01F3,0x7FFF,0x0026,0x00C5,0x00C6
  711.         dc.w 0x011A,0x011B,0x7FFF,0x0027,0x00AA,0x00AB
  712.         dc.w 0x00D8,0x00D9,0x0136,0x0137,0x7FFF,0x0028
  713.         dc.w 0x0119,0x011A,0x0135,0x0136,0x7FFF,0x0029
  714.         dc.w 0x00C6,0x00C7,0x00D7,0x00D8,0x0118,0x0119
  715.         dc.w 0x7FFF,0x002A,0x00AB,0x00AC,0x00C7,0x00C8
  716.         dc.w 0x0134,0x0135,0x7FFF,0x002B,0x00AC,0x00AD
  717.         dc.w 0x00C8,0x00C9,0x00D6,0x00D7,0x0117,0x0118
  718.         dc.w 0x0133,0x0134,0x7FFF,0x002C,0x00C9,0x00CA
  719.         dc.w 0x00D4,0x00D6,0x00F3,0x00F4,0x0116,0x0117
  720.         dc.w 0x7FFF,0x002D,0x00AD,0x00AE,0x00CA,0x00CD
  721.         dc.w 0x00D1,0x00D4,0x0132,0x0133,0x7FFF,0x002E
  722.         dc.w 0x00AE,0x00AF,0x00CD,0x00D1,0x0115,0x0116
  723.         dc.w 0x0131,0x0132,0x7FFF,0x002F,0x00AF,0x00B0
  724.         dc.w 0x00F2,0x00F3,0x0114,0x0115,0x0130,0x0131
  725.         dc.w 0x7FFF,0x0030,0x00B0,0x00B1,0x0113,0x0114
  726.         dc.w 0x7FFF,0x0031,0x00B1,0x00B2,0x0112,0x0113
  727.         dc.w 0x012F,0x0130,0x7FFF,0x0032,0x0070,0x0077
  728.         dc.w 0x007E,0x0085,0x008D,0x0092,0x009F,0x00A3
  729.         dc.w 0x00B2,0x00B3,0x00F1,0x00F2,0x0111,0x0112
  730.         dc.w 0x012E,0x012F,0x0141,0x0146,0x014C,0x0151
  731.         dc.w 0x0158,0x015D,0x016A,0x016E,0x0173,0x0178
  732.         dc.w 0x017C,0x017E,0x7FFF,0x0033,0x0077,0x0078
  733.         dc.w 0x009C,0x009F,0x00A3,0x00A6,0x00B3,0x00B5
  734.         dc.w 0x012D,0x012E,0x0167,0x016A,0x016E,0x0171
  735.         dc.w 0x017B,0x017C,0x017E,0x0181,0x7FFF,0x0034
  736.         dc.w 0x007D,0x007E,0x0092,0x0093,0x009B,0x009C
  737.         dc.w 0x00A5,0x00A6,0x00B5,0x00B6,0x00F0,0x00F1
  738.         dc.w 0x0110,0x0111,0x012C,0x012D,0x015D,0x015E
  739.         dc.w 0x0166,0x0167,0x0170,0x0171,0x0180,0x0181
  740.         dc.w 0x7FFF,0x0035,0x008C,0x008D,0x009A,0x009B
  741.         dc.w 0x00B6,0x00B8,0x010F,0x0110,0x012B,0x012C
  742.         dc.w 0x0157,0x0158,0x0165,0x0166,0x017A,0x017B
  743.         dc.w 0x017F,0x0180,0x7FFF,0x0036,0x0078,0x0079
  744.         dc.w 0x0099,0x009A,0x009F,0x00A5,0x00B8,0x00BB
  745.         dc.w 0x00EF,0x00F0,0x010E,0x010F,0x012A,0x012B
  746.         dc.w 0x0164,0x0165,0x016A,0x0170,0x017E,0x017F
  747.         dc.w 0x7FFF,0x0037,0x007C,0x007D,0x0093,0x0094
  748.         dc.w 0x009E,0x009F,0x00BB,0x00BE,0x010D,0x010E
  749.         dc.w 0x0129,0x012A,0x015E,0x015F,0x0169,0x016A
  750.         dc.w 0x0179,0x017A,0x7FFF,0x0038,0x008B,0x008C
  751.         dc.w 0x008E,0x0090,0x0098,0x0099,0x009D,0x009E
  752.         dc.w 0x00BE,0x00C2,0x00D0,0x00D4,0x00EE,0x00EF
  753.         dc.w 0x010C,0x010D,0x0128,0x0129,0x0146,0x014C
  754.         dc.w 0x0156,0x0157,0x0159,0x015B,0x0163,0x0164
  755.         dc.w 0x0168,0x0169,0x0178,0x0179,0x017D,0x017E
  756.         dc.w 0x7FFF,0x0039,0x0074,0x0075,0x0079,0x007A
  757.         dc.w 0x007F,0x0080,0x00C2,0x00D0,0x010B,0x010C
  758.         dc.w 0x017C,0x017D,0x7FFF,0x003A,0x007B,0x007C
  759.         dc.w 0x008A,0x008B,0x0094,0x0095,0x00D3,0x00D4
  760.         dc.w 0x00ED,0x00EE,0x010A,0x010B,0x0127,0x0128
  761.         dc.w 0x0155,0x0156,0x015F,0x0160,0x017C,0x017D
  762.         dc.w 0x7FFF,0x003B,0x0075,0x0076,0x008D,0x008E
  763.         dc.w 0x0090,0x0091,0x00EC,0x00ED,0x0109,0x010A
  764.         dc.w 0x0126,0x0127,0x0146,0x014C,0x0158,0x0159
  765.         dc.w 0x015B,0x015C,0x017D,0x017E,0x7FFF,0x003C
  766.         dc.w 0x007A,0x007B,0x007E,0x007F,0x008D,0x0091
  767.         dc.w 0x0095,0x0096,0x0098,0x0099,0x00D2,0x00D3
  768.         dc.w 0x0108,0x0109,0x0125,0x0126,0x0158,0x015C
  769.         dc.w 0x0160,0x0161,0x0163,0x0164,0x0178,0x0179
  770.         dc.w 0x7FFF,0x003D,0x0089,0x008A,0x009D,0x009E
  771.         dc.w 0x00D1,0x00D2,0x00EB,0x00EC,0x0107,0x0108
  772.         dc.w 0x0124,0x0125,0x0154,0x0155,0x0168,0x0169
  773.         dc.w 0x0179,0x017A,0x017E,0x017F,0x7FFF,0x003E
  774.         dc.w 0x0076,0x0077,0x007D,0x007E,0x009E,0x009F
  775.         dc.w 0x00EA,0x00EB,0x0106,0x0107,0x0123,0x0124
  776.         dc.w 0x0169,0x016A,0x017F,0x0180,0x7FFF,0x003F
  777.         dc.w 0x0088,0x0089,0x008C,0x0092,0x0096,0x0097
  778.         dc.w 0x0099,0x009A,0x009F,0x00A5,0x00D0,0x00D1
  779.         dc.w 0x0105,0x0106,0x0122,0x0123,0x0153,0x0154
  780.         dc.w 0x0157,0x015D,0x0161,0x0162,0x0164,0x0165
  781.         dc.w 0x016A,0x0170,0x017A,0x017B,0x0180,0x0181
  782.         dc.w 0x7FFF,0x0040,0x009A,0x009B,0x00CF,0x00D0
  783.         dc.w 0x00E9,0x00EA,0x0104,0x0105,0x0121,0x0122
  784.         dc.w 0x0165,0x0166,0x7FFF,0x0041,0x0077,0x0078
  785.         dc.w 0x007C,0x007D,0x008B,0x008C,0x009B,0x009D
  786.         dc.w 0x00A5,0x00A6,0x00CE,0x00CF,0x00E8,0x00E9
  787.         dc.w 0x0103,0x0104,0x0120,0x0121,0x0156,0x0157
  788.         dc.w 0x0166,0x0168,0x0170,0x0171,0x017B,0x017C
  789.         dc.w 0x0181,0x0182,0x7FFF,0x0042,0x0087,0x0088
  790.         dc.w 0x0092,0x0093,0x0097,0x0098,0x009D,0x00A0
  791.         dc.w 0x00A4,0x00A6,0x00CD,0x00CE,0x00E7,0x00E8
  792.         dc.w 0x0102,0x0103,0x011F,0x0120,0x0152,0x0153
  793.         dc.w 0x015D,0x015E,0x0162,0x0163,0x0168,0x016B
  794.         dc.w 0x016F,0x0171,0x017C,0x017D,0x017F,0x0182
  795.         dc.w 0x7FFF,0x0043,0x0070,0x0074,0x0078,0x007C
  796.         dc.w 0x0080,0x0085,0x0087,0x008B,0x0093,0x0098
  797.         dc.w 0x00A0,0x00A4,0x00CC,0x00CD,0x00E6,0x00E7
  798.         dc.w 0x0101,0x0102,0x011E,0x011F,0x0141,0x0146
  799.         dc.w 0x014C,0x0151,0x0152,0x0156,0x015E,0x0163
  800.         dc.w 0x016B,0x016F,0x0173,0x0178,0x017D,0x017F
  801.         dc.w 0x7FFF,0x0044,0x00CB,0x00CC,0x00E5,0x00E6
  802.         dc.w 0x0100,0x0101,0x011D,0x011E,0x7FFF,0x0045
  803.         dc.w 0x00CA,0x00CB,0x00E4,0x00E5,0x00FF,0x0100
  804.         dc.w 0x011C,0x011D,0x7FFF,0x0046,0x00C8,0x00CA
  805.         dc.w 0x00E3,0x00E4,0x00FE,0x00FF,0x011B,0x011C
  806.         dc.w 0x7FFF,0x0047,0x00C7,0x00C8,0x00E2,0x00E3
  807.         dc.w 0x00FD,0x00FE,0x011A,0x011B,0x7FFF,0x0048
  808.         dc.w 0x00C5,0x00C7,0x00E1,0x00E2,0x00FC,0x00FD
  809.         dc.w 0x0119,0x011A,0x7FFF,0x0049,0x00C4,0x00C5
  810.         dc.w 0x00E0,0x00E1,0x00FA,0x00FC,0x0119,0x013C
  811.         dc.w 0x7FFF,0x004A,0x00C2,0x00C4,0x00DF,0x00E0
  812.         dc.w 0x00F9,0x00FA,0x7FFF,0x004B,0x00C0,0x00C2
  813.         dc.w 0x00DE,0x00DF,0x00F8,0x00F9,0x7FFF,0x004C
  814.         dc.w 0x00BE,0x00C0,0x00DC,0x00DE,0x00F7,0x00F8
  815.         dc.w 0x7FFF,0x004D,0x00BC,0x00BE,0x00DB,0x00DC
  816.         dc.w 0x00F6,0x00F7,0x7FFF,0x004E,0x00B9,0x00BC
  817.         dc.w 0x00D9,0x00DB,0x00F5,0x00F6,0x7FFF,0x004F
  818.         dc.w 0x00B5,0x00B9,0x00D8,0x00D9,0x00F4,0x00F5
  819.         dc.w 0x7FFF,0x0050,0x00B1,0x00B5,0x00D7,0x00D8
  820.         dc.w 0x7FFF,0x0051,0x00D5,0x00D7,0x7FFF,0x0052
  821.         dc.w 0x00D3,0x00D5,0x7FFF,0x0053,0x00D1,0x00D3
  822.         dc.w 0x7FFF,0x0054,0x00CF,0x00D1,0x7FFF,0x0055
  823.         dc.w 0x00CD,0x00CF,0x7FFF,0x0056,0x00CB,0x00CD
  824.         dc.w 0x7FFF,0x0057,0x00C8,0x00CB,0x7FFF,0x0058
  825.         dc.w 0x00C5,0x00C8,0x7FFF,0x0059,0x00C2,0x00C5
  826.         dc.w 0x7FFF,0x005A,0x00BF,0x00C2,0x00F4,0x00F5
  827.         dc.w 0x7FFF,0x005B,0x0004,0x00B1,0x00BF,0x00F5
  828.         dc.w 0x013C,0x01F3,0x7FFF,0x005D,0x0002,0x01F5
  829.         dc.w 0x7FFF,0x005E,0x0001,0x01F6,0x7FFF,0x005F
  830.         dc.w 0x0000,0x01F7,0x7FFF,0x7FFF
  831.     };
  832. }
  833.  
  834. void endLongData()
  835. {
  836.     ;
  837. }
  838.  
  839.  
  840. /********************************************************************************
  841.   DrawHackCont
  842.   
  843.       Creative things here !    (send me your best, I'll pay the postage  :-)
  844.  
  845. *********************************************************************************/
  846.  
  847. void    DrawHackCont()
  848. {
  849.     return;
  850. }
  851.  
  852.  
  853.  
  854. //********************************************************************************
  855. //                                                B E G I N    R G N   B U I L D
  856. //        run with a compile time flag once
  857. //        to generate the rgn data. No outline
  858. //        fonts at WDEF time, especially the 
  859. //        right ones !  (has to look good!)
  860.  
  861.  
  862. /********************************************************************************
  863.   MakeRgnBg
  864.   
  865.       Make a file, find it, get the data.   ;-)
  866.       
  867.       After making the Rgn with this routine, I used ResEdit to copy the data
  868.       as hex and ran an mpw script to turn it into embedded data
  869.       
  870.       find •;replace -c ∞ /(?«4»)®1/ '0x'®1','
  871.     find •;replace -c ∞ /(?«41»)®1,/ ®1∂n∂t∂t'dc.w '
  872.     
  873.     (fix the boundries after you run the script)
  874.  
  875. *********************************************************************************/
  876. void MakeRgnBg()
  877. {
  878.     PicHandle        p;
  879.     RgnHandle        r;
  880.     short            resFileID;
  881.  
  882.     //Debugger();
  883.     p = (Handle)GetResource( 'PICT', 128);
  884.     r = PICT2Rgn( p);
  885.     CreateResFile( "\ptemp");
  886.     resFileID = OpenResFile( "\ptemp");
  887.     AddResource( (Handle)r, 'tRgn', 1024, "\pwinBg");
  888.     WriteResource( (Handle)r);
  889.     CloseResFile( resFileID);
  890.     return;
  891. }
  892.  
  893. /********************************************************************************
  894.   PICT2Rgn
  895.   
  896.       Using a PicHandle, create the region (1 bit) described by the drawn PICT.
  897.      At present, make no adjustment for PICT frame.
  898.   
  899. *********************************************************************************/
  900. RgnHandle    PICT2Rgn( PicHandle p )
  901. {
  902.     GrafPtr            aGP;
  903.     GrafPtr            savPort;
  904.     Rect            gpRect;
  905.     OSErr            err;
  906.     BitMap            *resBM;
  907.     RgnHandle        rH;
  908.  
  909.     if(!p) return 0;
  910.     
  911.     gpRect = (**p).picFrame;
  912.     
  913.     rH = NewRgn();
  914.     
  915.     // Ditch the trap check, General Purpose -(NOT!)
  916.     
  917.     //if ( TrapAvailable( 0xA8D7)) {
  918.         if ( CreateOffscreenBitMap( &aGP, &gpRect ) ) {
  919.             //CheckAllocation( resBM=(BitMap*)NewPtr( sizeof(BitMap)));
  920.             resBM=(BitMap*)NewPtr( sizeof(BitMap));
  921.             GetPort( &savPort);        
  922.             SetPort( aGP);
  923.             DrawPicture( p, &gpRect);
  924.                                             /* Bad news iff aGP is a color port */
  925.             *resBM = aGP->portBits;
  926.     
  927.             if ( err = BitMapToRegion( rH, resBM)) {
  928.                 DisposeRgn( rH );
  929.                 rH = 0;
  930.             }
  931.     
  932.               ClosePort( aGP);
  933.             DisposPtr( (Ptr)aGP);
  934.     
  935.             //gError->CheckOSError( err = QDError());
  936.             DisposPtr( resBM->baseAddr);
  937.             DisposPtr( (Ptr)resBM);
  938.             SetPort( savPort);
  939.         } else {
  940.             DisposeRgn( rH);
  941.             rH = 0;
  942.         }
  943.     //} else {
  944.     //    OpenRgn();
  945.     //    FrameRect( &gpRect);
  946.     //    CloseRgn( rH);
  947.     //}
  948.     
  949.     return rH;
  950. }
  951.  
  952.  
  953. /********************************************************************************
  954.   PICT2BitMap
  955.   
  956. *********************************************************************************/
  957. BitMap    *PICT2BitMap( PicHandle p )
  958. {
  959.     GrafPtr            aGP;
  960.     GrafPtr            savPort;
  961.     Rect            gpRect;
  962.     BitMap            *resBM;
  963.     
  964.     if(!p) return 0;
  965.     resBM = (BitMap *)NewPtr( sizeof( BitMap ));
  966.     //CheckAllocation( resBM = (BitMap *)NewPtr( sizeof( BitMap ) ) );
  967.     
  968.     gpRect = (**p).picFrame;
  969.     if ( CreateOffscreenBitMap( &aGP, &gpRect ) ) {
  970.  
  971.         GetPort( &savPort );        SetPort( aGP );
  972.         DrawPicture( p, &gpRect );
  973.                                         /* Bad news iff really color port */
  974.         *resBM = aGP->portBits;
  975.           ClosePort(aGP);
  976.         DisposPtr((Ptr)aGP);
  977.         SetPort( savPort );
  978.     } else {
  979.         resBM->baseAddr = 0;
  980.         resBM->rowBytes = 0;
  981.         SetRect( &resBM->bounds, 0, 0, 0, 0 );
  982.     }
  983.     
  984.     return resBM;
  985. }
  986.  
  987.  
  988.  
  989. /********************************************************************************
  990.   CreateOffscreenBitMap
  991.                               from DTS TechNote #41
  992. *********************************************************************************/
  993. Boolean CreateOffscreenBitMap(GrafPtr *newOffscreen, Rect *inBounds)
  994. {
  995.   GrafPtr savePort;
  996.   GrafPtr newPort;
  997.  
  998.   GetPort(&savePort);    /* need this to restore thePort after OpenPort */
  999.  
  1000.   newPort = (GrafPtr) NewPtr(sizeof(GrafPort));    /* allocate the grafPort */
  1001.   if (MemError() != noErr)
  1002.     return false;                 /* failed to allocate the off-screen port */
  1003.  
  1004.   /*
  1005.   the call to OpenPort does the following . . . 
  1006.     allocates space for visRgn (set to screenBits.bounds)
  1007.     and clipRgn (set wide open)
  1008.     sets portBits to screenBits
  1009.     sets portRect to screenBits.bounds
  1010.     etc. (see IM I-163,164)
  1011.     side effect: does a SetPort(&offScreen)
  1012.   */
  1013.   OpenPort(newPort);
  1014.   /* make bitmap the size of the bounds that caller supplied */
  1015.   newPort->portRect = *inBounds;
  1016.   newPort->portBits.bounds = *inBounds;
  1017.   RectRgn(newPort->clipRgn, inBounds);/* avoid wide-open clipRgn, to be safe  */
  1018.   RectRgn(newPort->visRgn, inBounds); /* in case newBounds is > screen bounds */
  1019.  
  1020.   /*rowBytes is size of row, it must be rounded up to an even number of bytes*/
  1021.   newPort->portBits.rowBytes =
  1022.            ((inBounds->right - inBounds->left + 15) >> 4) << 1;
  1023.  
  1024.   /* number of bytes in BitMap is rowBytes * number of rows */
  1025.   /* see notes at end of Technical Note about using _NewHandle
  1026.      rather than _NewPtr */
  1027.   newPort->portBits.baseAddr =
  1028.            NewPtr(newPort->portBits.rowBytes * (long)
  1029.            (inBounds->bottom - inBounds->top));
  1030.   if (MemError()!=noErr) { /* check to see if we had enough room for the bits */
  1031.     SetPort(savePort);
  1032.     ClosePort(newPort);      /* dump the visRgn and clipRgn */
  1033.     DisposPtr((Ptr)newPort); /* dump the GrafPort */
  1034.     return false;            /* tell caller we failed */
  1035.     }
  1036.   /* since the bits are just memory, let's clear them before we start */
  1037.   EraseRect(inBounds);     /* OpenPort did a SetPort(newPort) so we are ok */
  1038.   *newOffscreen = newPort;
  1039.   SetPort(savePort);
  1040.   return true;               /* tell caller we succeeded! */
  1041. }
  1042.  
  1043.  
  1044. /********************************************************************************
  1045.   DestroyOffscreenBitMap
  1046.                               from DTS TechNote #41
  1047. *********************************************************************************/
  1048.  
  1049. void DestroyOffscreenBitMap(GrafPtr oldOffscreen)
  1050. {
  1051.   ClosePort(oldOffscreen);                     /* dump the visRgn and clipRgn */
  1052.   DisposPtr(oldOffscreen->portBits.baseAddr);  /* dump the bits */
  1053.   DisposPtr((Ptr)oldOffscreen);                /* dump the port */
  1054. }
  1055.  
  1056.  
  1057.  
  1058.  
  1059. //**************************************************************************
  1060.                                             //  E N D   O F  L I S T I N G